feat: enforce authz permissions for Pages & Resources endpoints#38275
feat: enforce authz permissions for Pages & Resources endpoints#38275wgu-taylor-payne wants to merge 1 commit intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @wgu-taylor-payne! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
cea9487 to
15104f1
Compare
Co-authored-by: Kiro <kiro@amazon.com>
15104f1 to
a327768
Compare
Description
When the
authz.enable_course_authoringflag is enabled use openedx-authz based permissions to authorize calls to the endpoints that support the Pages & Resources pages and functionality in Studio.Endpoints covered
Pages & Resources
/api/course_apps/v1/apps/{courseId}openedx.core.djangoapps.course_apps.rest_api.v1.views.CourseAppsView/api/course_apps/v1/apps/{courseId}openedx.core.djangoapps.course_apps.rest_api.v1.views.CourseAppsView/api/contentstore/v0/advanced_settings/{courseId}cms.djangoapps.contentstore.rest_api.v0.views.advanced_settings.AdvancedCourseSettingsView*/api/contentstore/v0/advanced_settings/{courseId}cms.djangoapps.contentstore.rest_api.v0.views.advanced_settings.AdvancedCourseSettingsView*Discussions
/api/discussions/v0/course/{courseId}/settingsopenedx.core.djangoapps.discussions.views.DiscussionsConfigurationSettingsView/api/discussions/v0/course/{courseId}/settingsopenedx.core.djangoapps.discussions.views.DiscussionsConfigurationSettingsView/api/discussions/v0/course/{courseId}/providersopenedx.core.djangoapps.discussions.views.DiscussionsProvidersViewCustom Pages
/api/contentstore/v0/tabs/{courseId}cms.djangoapps.contentstore.rest_api.v0.views.tabs.CourseTabListView/api/contentstore/v0/tabs/{courseId}/reordercms.djangoapps.contentstore.rest_api.v0.views.tabs.CourseTabReorderView/api/contentstore/v0/tabs/{courseId}/settingscms.djangoapps.contentstore.rest_api.v0.views.tabs.CourseTabSettingsView/xblock/cms.djangoapps.contentstore.views.component.xblock_handler*/xblock/{blockId}cms.djangoapps.contentstore.views.component.xblock_handler*/xblock/{blockId}cms.djangoapps.contentstore.views.component.xblock_handler*Textbooks
/api/contentstore/v1/textbooks/{courseId}cms.djangoapps.contentstore.rest_api.v1.views.textbooks.CourseTextbooksView/textbooks/{courseId}cms.djangoapps.contentstore.views.course.textbooks_list_handler/textbooks/{courseId}/{textbookId}cms.djangoapps.contentstore.views.course.textbooks_detail_handler/textbooks/{courseId}/{textbookId}cms.djangoapps.contentstore.views.course.textbooks_detail_handler* Not modified in this PR — shared endpoints used by other features.
Supporting information
Closes openedx/openedx-authz#192.
Testing instructions
Automated tests:
pytest --ds="cms.envs.test" \ cms/djangoapps/contentstore/rest_api/v0/tests/test_tabs_permissions.py \ cms/djangoapps/contentstore/rest_api/v1/views/tests/test_textbooks.py \ cms/djangoapps/contentstore/views/tests/test_textbooks_permissions.py \ openedx/core/djangoapps/course_apps/rest_api/tests/test_views_permissions.py \ openedx/core/djangoapps/discussions/tests/test_views_permissions.pyManual tests:
Prerequisite: Enable the
authz.enable_course_authoringwaffle flag for the test course. Assign users to authz roles:course_admin,course_staff,course_auditor, and one user with no role.xblock_handlerwhich is out of scope for this PR.Deadline
Verawood
Other information
Co-authored with Kiro.